package org.example;

import com.github.javaparser.JavaParser;
import com.github.javaparser.ParseResult;
import com.github.javaparser.ast.CompilationUnit;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class JavaParserExample {
    public static void main(String[] args) {
        try  {
            FileInputStream in = new FileInputStream("F:\\java-opensource\\findusesql\\src\\main\\java\\org\\example\\SQLKeywords.java");
            // 调用JavaParser的静态parse方法解析Java文件
            JavaParser javaParser = new JavaParser();
            ParseResult<CompilationUnit> cu = javaParser.parse(in);
            // 现在你可以遍历或修改cu（CompilationUnit）了
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
